#include <cstdlib>
#include <string>
#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
	string say(string seq){
		string s;
		int count = 1, idx = 0;
		char num = seq[0];
		while (idx != seq.length() - 1){
			idx++;
			if (seq[idx] != num){
				s = s + std::to_string(count) + num;
				num = seq[idx];
				count = 1;
			}
			else
				count++;
		}
		return s + std::to_string(count) + num;
	}
public:
	string countAndSay(int n) {
		if (n == 1){
			return "1";
		}
		else
			return say(countAndSay(n - 1));
	}
};

int main(int argc, char** argv){
	auto s = Solution();
	cout << s.countAndSay(1) << endl;
	return 0;
}